package android.apps.bean;

import java.util.Comparator;

/**
 * 按时间排序；
 * Created by lcy on 2015/12/25.
 */
public class ComparatorTime implements Comparator {

    public int compare(Object arg0, Object arg1) {
        PhotoUpImageItem photo1 = (PhotoUpImageItem) arg0;
        PhotoUpImageItem photo2 = (PhotoUpImageItem) arg1;
        //比较时间；
        if (photo1.getDatatime()!=null&&photo2.getDatatime()!=null){
            return photo2.getDatatime().compareTo(photo1.getDatatime());
        }else {
            return 0;
        }
    }
}
